package com.jdk8.lambda_02;

import java.util.Arrays;
import java.util.List;
import java.util.function.Consumer;

public class ConsumerDemo {

    public static <T> void show(List<T> list, Consumer<T> consumer) {
        for (T t : list) {
            consumer.accept(t);
        }
    }

    public static void main(String[] args) {
        /*Consumer<String> consumer = new Consumer() {
            @Override
            public void accept(Object o) {

            }
        };*/
        

        List<String> list = Arrays.asList("sss", "ddd", "fff");
        show(list,(String str) -> System.out.println(str));
    }
}
